<?php
require('config.php');

        $user_id=$_REQUEST['user_id'];
        $time=time();
		$sql="select * from `".$oto."_youhui_user_link`,`".$oto."_youhui` where ".$oto."_youhui_user_link.user_id='{$user_id}' and u_is_effect='1' and ".$oto."_youhui_user_link.youhui_id=".$oto."_youhui.id";
		$result=$db->query($sql);
		while($row=$result->fetch_assoc()){
			$yhq_info[]=$row;//将取得的所有数据赋值给person_info数组
		}
		if(!isset($yhq_info))
		{
			$yhq_info='';
		}
		else
		{
			for($i=0;$i<count($yhq_info);$i++)
			{
				if($yhq_info[$i]['end_time']<$time)
				{
					$youhui_id=$yhq_info[$i]['youhui_id'];
					$sql="update ".$oto."_youhui_user_link set u_is_effect='0' where user_id='{$user_id}' and youhui_id='{$youhui_id}'";
					$result=$db->query($sql);
				}
			}
		}
		echo json_encode($yhq_info);
?>